package models

import "reflect"

// Article 文章实体
type Article struct {
	ID           string   `form:"id"`
	Title        string   `form:"title"`
	Introduction string   `form:"introduction"`
	Content      string   `form:"content"`
	ContentByte  []byte   `form:"ContentByte"`
	Time         string   `form:"time"`
	Category     string   `form:"category"`
	Tags         []string `form:"tags"`
	Cover        string   `form:"cover"`
}

// ArticlePage 文章分页
type ArticlePage struct {
	PrevPage    int       `json:"prevPage"`
	NextPage    int       `json:"nextPage"`
	HasPrevPage bool      `json:"hasPrevPage"`
	HasNextPage bool      `json:"hasNextPage"`
	Rows        []Article `json:"rows"`
}

// IsEmpty 验证是否为nil
func (a Article) IsEmpty() bool {
	return reflect.DeepEqual(a, Article{})
}
